#!/bin/bash
#
set -x
cd `dirname $0`
version=$(git tag |tail -n 1 )
mkdir /root/.pip -p && cp pip.conf  /root/.pip/

pip3 install -r requirements.txt

if python3 -m pytest ; then 
    image_name=hub.hasebook.com/demo/page:$version
    docker build -t  $image_name .
    docker push $image_name 
else
   exit 1
fi


